/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import com.mysql.jdbc.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author jarul
 */
public class DBKoneksi {
    
    private static Connection koneksi;
    
    public static Connection getConnection() {
        
        if(koneksi==null) {
            try {
                DriverManager.registerDriver(new com.mysql.jdbc.Driver());
                koneksi = (Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/MVC", "root", "toor");
            } catch (SQLException ex) {
                Logger.getLogger(DBKoneksi.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        
        return koneksi;
    }
    
}
